// WARNING: For GET requests, body is set to null by browsers.

var xhr = new XMLHttpRequest();

xhr.addEventListener("readystatechange", function() {
   if(this.readyState === 4) {
      console.log(this.responseText);
   }
});

xhr.open("GET", "https://pcapi-xiaotuxian-front.itheima.net/hot/preference?subType&pageSize=10&page=1");

xhr.send();